deploy: Retain staged by default
authorColin Walters <walters@verbum.org>
Tue, 3 Jul 2018 21:28:48 +0000 (17:28 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 6 Jul 2018 15:23:52 +0000 (15:23 +0000)
commit7468600029d01b6fe2db81ebbfb86f7648b2b120
treec35e73f2b5b4278520d9f15364ce994b1a77b90c
parent10c2fc33f68fbc7d8b9d29888d76cc0b44a170be
deploy: Retain staged by default

For `rpm-ostree ex livefs` we have a use case of pushing a rollback
deployment.  There's no reason this should require deleting the staged
deployment (and doing so actually breaks livefs which tries to access
it as a data source).

I was initially very conservative here, but I think it ends up
being fairly easy to retain the staged deployment.  We need to handle
two cases:

First, when the staged is *intentionally* deleted; here, we just need
to unlink the `/run` file, and then everything will be sync'd up after
reloading.

Second, (as in the livefs case) where we're retaining it,
e.g. adding a deployment to the end.  What I realized here is that
we can have the code keep `new_deployments` as view without staged,
and then when we do the final reload we'll end up re-reading it from
disk anyways.

Closes: #1672
Approved by: jlebon
src/libostree/ostree-sysroot-deploy.c
tests/installed/destructive/staged-deploy.yml